class Solution:
    def removeElement(self, nums: List[int], val: int) -> int:
        index = -1;
        length = len(nums)
        for i in range(length):
            if val != nums[i]:
                index += 1
                nums[index] = nums[i]
            else:
                continue
        return index + 1
